

function BOList () {
	
}

/**
* 绑定点击提交AJAX
* domClick	点击的节点	 obj_[[]].formSearch.find('.btn-delete-false')
* table	对应的表格	obj_[[]].table.table
* title	提示标题	确定删除
* text	提示内容	若删除该数据将无法显示
* ajaxUrl	提交地址	/api/inter/[[${menu.tableName}]]/deleteFalse
* fields
*/
function bindClickCommitAjax(domClick, table, title, text, ajaxUrl, fields) {
	
	domClick.click(function(){
    	var row = table.bootstrapTable('getSelections')[0];
    	if (!row || row == null) {
			alert("请选择一条数据");
			return;
		}
    	
		var dataAjar = {};
		for (var i = 0; i < fields.length; i++) {
			dataAjar[fields[i].fieldName] = row[fields[i].fieldName];
		}
    	
        swal({
            title: title,
            text: text,
            type: "warning",
            showCancelButton: true,
            confirmButtonColor: "#DD6B55",
            confirmButtonText: "确定！",
            cancelButtonText: "取消",
            closeOnConfirm: false
        },
        function () {
            $.ajax({
                type: "POST",
                url: ajaxUrl,
                data: dataAjar,
                success: function (data) {
                    if (data.code == 0) {
                    	swal("提示!", data.msg, "success");
                    	table.bootstrapTable("refresh");
                    } else {
                        alert(data.msg);
                    }
                }
            });
        });
	});
}